package br.pesquisa.lsystem;

import java.util.ArrayList;
import java.util.List;

public class Producao<T> {
	private T predecessor;

	private List<T> sucessor;

	public Producao() {
		sucessor = new ArrayList<T>();
	}

	public T getPredecessor() {
		return predecessor;
	}

	public void setPredecessor(T predecessor) {
		this.predecessor = predecessor;
	}

	public List<T> getSucessor() {
		return sucessor;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}

		if (obj instanceof Producao) {
			Producao that = (Producao) obj;
			if ((predecessor == that.predecessor || (predecessor != null && predecessor
					.equals(that.predecessor)))
					/*&& (sucessor == that.sucessor || (sucessor != null && sucessor
							.equals(that.sucessor)))*/) {
				return true;
			}
		}

		return false;
	}

	@Override
	public String toString() {
		return predecessor.toString() + " -> " + sucessor.toString();
	}
}
